home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_ul.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  4.8 KB  |  103 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="400" height="380" caption="Unordered list">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <panel name="pnlMain" caption="" align="altop" taborder="0" hint="" width="383" height="56" top="1" left="1" bevelinner="bvnone" bevelouter="bvnone">
  6.                 <label name="lblItemCount" caption="Number of items" hint="" width="29" height="13" top="16" left="8"/>
  7.                 <label name="lblType" caption="Type" hint="" width="56" height="13" top="16" left="190"/>
  8.                 <combobox name="comType" taborder="1" text="" hint="Select the type of items your list should use." width="170" height="21" top="32" left="190">
  9.                     <items>
  10.                         circle
  11.                         square
  12.                         disc
  13.                     </items>
  14.                 </combobox>
  15.                 <spinedit name="speItemCount" taborder="0" hint="Choose how many items you want in your list." maxvalue="100" minvalue="1" value="1" width="170" height="20" top="32" left="8">
  16.                     <event type="onchange">
  17.                         stgItems.RowCount := speItemCount.Value+1;
  18.                     </event>
  19.                 </spinedit>
  20.             </panel>
  21.             <panel name="pnlList" caption="" align="altop" taborder="1" hint="" width="383" height="143" top="57" left="1" bevelinner="bvnone" bevelouter="bvnone">
  22.                 <label name="lblItems" caption="List elements" hint="" width="81" height="13" top="8" left="8"/>
  23.                 <stringgrid name="stgItems" left="8" top="23" width="353" height="104" rowcount="2" colcount="2" fixedcols="1" fixedrows="1" ctl3d="0" defaultcolwidth="20" defaultrowheight="15"/>
  24.             </panel>
  25.         </panel>
  26.     </controls>
  27.     <dialogevents>
  28.         <event type="onclose" resulttype="ok">
  29.             StartCode := '<ul';
  30.             If comType.Text <> '' then
  31.              StartCode := StartCode + ' type="'+comType.Text+'"';
  32.               If edtCSSClass.Text <> '' then
  33.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  34.               If edtCSSId.Text <> '' then
  35.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  36.               If edtCSSStyle.Text <> '' then
  37.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  38.             for i := 0 to EventGrid.Count - 1 do
  39.               begin
  40.               if EventGrid.Rows[i].EditText <> '' then
  41.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  42.              end;  
  43.             StartCode := StartCode + '>'; 
  44.             EndCode := #13#10;
  45.             for i := 1 to stgItems.RowCount - 1 do
  46.              EndCode := EndCode + (#9+'<li>' + stgItems.Cells[1,i] + '</li>'+#13#10);            
  47.             EndCode := EndCode + '</ul>';
  48.             If cbMakeXHTMLCompliant.Checked then
  49.              StartCode := MakeXHTMLCompliant(StartCode, true);             
  50.             If cbDoPHPEscape.Checked then
  51.              StartCode := DoPHPEscape(StartCode);
  52.             // A little "hack" - WebCoder will set this, to let us know whether to update
  53.             // an existing tag, or insert a brand new one
  54.             If cbUpdateExistingTag.Checked then 
  55.              ReplaceTag(StartCode)
  56.             else 
  57.                InsertTags(StartCode+EndCode, '');   
  58.               
  59.         </event>
  60.         <event type="onshow">    
  61.             // Specific for this dialog
  62.             stgItems.ColWidths[1] := stgItems.Width - stgItems.ColWidths[0];
  63.             stgItems.Options := [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing];
  64.             If cbUpdateExistingTag.Checked then
  65.              begin
  66.               pnlList.Visible := false;
  67.               Self.Height := Self.Height-pnlList.Height;
  68.               speItemCount.Enabled := false;              
  69.              end;            
  70.             // Lets put the advanced panel in the right place
  71.             pnlAdvanced.Parent := MainPanel;
  72.             pnlAdvanced.Left := 8;
  73.             pnlAdvanced.Top := MainPanel.Height - 32;        
  74.             pnlAdvanced.Width := Self.Width - 36;
  75.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  76.             If pnlAdvanced.Height > 20 then
  77.              Self.Height := Self.Height + 200;
  78.             Self.ActiveControl := MainPanel;
  79.             MainPanel.SetFocus; 
  80.         </event>
  81.         <event type="updatedialog">
  82.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  83.             // The entire selected tag will be passed as a parameter to this function, that should update
  84.             // the required fields of the dialog.
  85.             function UpdateDialog(Tag: string);
  86.              begin
  87.               comType.Text := GetValueFromAttribute(Tag, 'type');
  88.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  89.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  90.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  91.               for i := 0 to EventGrid.Count - 1 do
  92.                 begin
  93.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  94.                  If EventVal <> '' then
  95.                   EventGrid.Rows[i].EditText := EventVal;
  96.                end;      
  97.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  98.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                        
  99.              end;
  100.         </event>
  101.     </dialogevents>
  102. </dialog>
  103.